home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / LINUX / NCP.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  6KB  |  197 lines

  1. /*
  2.  *  ncp.h
  3.  *
  4.  *  Copyright (C) 1995 by Volker Lendecke
  5.  *  Modified for sparc by J.F. Chadima
  6.  *
  7.  */
  8.  
  9. #ifndef _LINUX_NCP_H
  10. #define _LINUX_NCP_H
  11.  
  12. #include <linux/types.h>
  13. #include <linux/ipx.h>
  14.  
  15. #define NCP_PTYPE                (0x11)
  16. #define NCP_PORT                 (0x0451)
  17.  
  18. #define NCP_ALLOC_SLOT_REQUEST   (0x1111)
  19. #define NCP_REQUEST              (0x2222)
  20. #define NCP_DEALLOC_SLOT_REQUEST (0x5555)
  21.  
  22. struct ncp_request_header {
  23.     __u16 type __attribute__((packed));
  24.     __u8 sequence __attribute__((packed));
  25.     __u8 conn_low __attribute__((packed));
  26.     __u8 task __attribute__((packed));
  27.     __u8 conn_high __attribute__((packed));
  28.     __u8 function __attribute__((packed));
  29.     __u8 data[0] __attribute__((packed));
  30. };
  31.  
  32. #define NCP_REPLY                (0x3333)
  33. #define NCP_POSITIVE_ACK         (0x9999)
  34.  
  35. struct ncp_reply_header {
  36.     __u16 type __attribute__((packed));
  37.     __u8 sequence __attribute__((packed));
  38.     __u8 conn_low __attribute__((packed));
  39.     __u8 task __attribute__((packed));
  40.     __u8 conn_high __attribute__((packed));
  41.     __u8 completion_code __attribute__((packed));
  42.     __u8 connection_state __attribute__((packed));
  43.     __u8 data[0] __attribute__((packed));
  44. };
  45.  
  46. #define NCP_VOLNAME_LEN (16)
  47. #define NCP_NUMBER_OF_VOLUMES (64)
  48. struct ncp_volume_info {
  49.     __u32 total_blocks;
  50.     __u32 free_blocks;
  51.     __u32 purgeable_blocks;
  52.     __u32 not_yet_purgeable_blocks;
  53.     __u32 total_dir_entries;
  54.     __u32 available_dir_entries;
  55.     __u8 sectors_per_block;
  56.     char volume_name[NCP_VOLNAME_LEN + 1];
  57. };
  58.  
  59. /* these define the attribute byte as seen by NCP */
  60. #define aRONLY     (ntohl(0x01000000))
  61. #define aHIDDEN    (ntohl(0x02000000))
  62. #define aSYSTEM    (ntohl(0x04000000))
  63. #define aEXECUTE   (ntohl(0x08000000))
  64. #define aDIR       (ntohl(0x10000000))
  65. #define aARCH      (ntohl(0x20000000))
  66.  
  67. #define AR_READ      (ntohs(0x0100))
  68. #define AR_WRITE     (ntohs(0x0200))
  69. #define AR_EXCLUSIVE (ntohs(0x2000))
  70.  
  71. #define NCP_FILE_ID_LEN 6
  72.  
  73. /* Defines for Name Spaces */
  74. #define NW_NS_DOS     0
  75. #define NW_NS_MAC     1
  76. #define NW_NS_NFS     2
  77. #define NW_NS_FTAM    3
  78. #define NW_NS_OS2     4
  79.  
  80. /*  Defines for ReturnInformationMask */
  81. #define RIM_NAME          (ntohl(0x01000000L))
  82. #define RIM_SPACE_ALLOCATED   (ntohl(0x02000000L))
  83. #define RIM_ATTRIBUTES          (ntohl(0x04000000L))
  84. #define RIM_DATA_SIZE          (ntohl(0x08000000L))
  85. #define RIM_TOTAL_SIZE          (ntohl(0x10000000L))
  86. #define RIM_EXT_ATTR_INFO     (ntohl(0x20000000L))
  87. #define RIM_ARCHIVE          (ntohl(0x40000000L))
  88. #define RIM_MODIFY          (ntohl(0x80000000L))
  89. #define RIM_CREATION          (ntohl(0x00010000L))
  90. #define RIM_OWNING_NAMESPACE  (ntohl(0x00020000L))
  91. #define RIM_DIRECTORY          (ntohl(0x00040000L))
  92. #define RIM_RIGHTS          (ntohl(0x00080000L))
  93. #define RIM_ALL           (ntohl(0xFF0F0000L))
  94. #define RIM_COMPRESSED_INFO   (ntohl(0x00000080L))
  95.  
  96. /* open/create modes */
  97. #define OC_MODE_OPEN      0x01
  98. #define OC_MODE_TRUNCATE  0x02
  99. #define OC_MODE_REPLACE   0x02
  100. #define OC_MODE_CREATE      0x08
  101.  
  102. /* open/create results */
  103. #define OC_ACTION_NONE       0x00
  104. #define OC_ACTION_OPEN       0x01
  105. #define OC_ACTION_CREATE   0x02
  106. #define OC_ACTION_TRUNCATE 0x04
  107. #define OC_ACTION_REPLACE  0x04
  108.  
  109. /* access rights attributes */
  110. #ifndef AR_READ_ONLY
  111. #define AR_READ_ONLY       0x0001
  112. #define AR_WRITE_ONLY       0x0002
  113. #define AR_DENY_READ       0x0004
  114. #define AR_DENY_WRITE       0x0008
  115. #define AR_COMPATIBILITY   0x0010
  116. #define AR_WRITE_THROUGH   0x0040
  117. #define AR_OPEN_COMPRESSED 0x0100
  118. #endif
  119.  
  120. struct nw_info_struct {
  121.     __u32 spaceAlloc __attribute__((packed));
  122.     __u32 attributes __attribute__((packed));
  123.     __u16 flags __attribute__((packed));
  124.     __u32 dataStreamSize __attribute__((packed));
  125.     __u32 totalStreamSize __attribute__((packed));
  126.     __u16 numberOfStreams __attribute__((packed));
  127.     __u16 creationTime __attribute__((packed));
  128.     __u16 creationDate __attribute__((packed));
  129.     __u32 creatorID __attribute__((packed));
  130.     __u16 modifyTime __attribute__((packed));
  131.     __u16 modifyDate __attribute__((packed));
  132.     __u32 modifierID __attribute__((packed));
  133.     __u16 lastAccessDate __attribute__((packed));
  134.     __u16 archiveTime __attribute__((packed));
  135.     __u16 archiveDate __attribute__((packed));
  136.     __u32 archiverID __attribute__((packed));
  137.     __u16 inheritedRightsMask __attribute__((packed));
  138.     __u32 dirEntNum __attribute__((packed));
  139.     __u32 DosDirNum __attribute__((packed));
  140.     __u32 volNumber __attribute__((packed));
  141.     __u32 EADataSize __attribute__((packed));
  142.     __u32 EAKeyCount __attribute__((packed));
  143.     __u32 EAKeySize __attribute__((packed));
  144.     __u32 NSCreator __attribute__((packed));
  145.     __u8 nameLen __attribute__((packed));
  146.     __u8 entryName[256] __attribute__((packed));
  147. };
  148.  
  149. /* modify mask - use with MODIFY_DOS_INFO structure */
  150. #define DM_ATTRIBUTES          (ntohl(0x02000000L))
  151. #define DM_CREATE_DATE          (ntohl(0x04000000L))
  152. #define DM_CREATE_TIME          (ntohl(0x08000000L))
  153. #define DM_CREATOR_ID          (ntohl(0x10000000L))
  154. #define DM_ARCHIVE_DATE       (ntohl(0x20000000L))
  155. #define DM_ARCHIVE_TIME       (ntohl(0x40000000L))
  156. #define DM_ARCHIVER_ID          (ntohl(0x80000000L))
  157. #define DM_MODIFY_DATE          (ntohl(0x00010000L))
  158. #define DM_MODIFY_TIME          (ntohl(0x00020000L))
  159. #define DM_MODIFIER_ID          (ntohl(0x00040000L))
  160. #define DM_LAST_ACCESS_DATE      (ntohl(0x00080000L))
  161. #define DM_INHERITED_RIGHTS_MASK  (ntohl(0x00100000L))
  162. #define DM_MAXIMUM_SPACE      (ntohl(0x00200000L))
  163.  
  164. struct nw_modify_dos_info {
  165.     __u32 attributes __attribute__((packed));
  166.     __u16 creationDate __attribute__((packed));
  167.     __u16 creationTime __attribute__((packed));
  168.     __u32 creatorID __attribute__((packed));
  169.     __u16 modifyDate __attribute__((packed));
  170.     __u16 modifyTime __attribute__((packed));
  171.     __u32 modifierID __attribute__((packed));
  172.     __u16 archiveDate __attribute__((packed));
  173.     __u16 archiveTime __attribute__((packed));
  174.     __u32 archiverID __attribute__((packed));
  175.     __u16 lastAccessDate __attribute__((packed));
  176.     __u16 inheritanceGrantMask __attribute__((packed));
  177.     __u16 inheritanceRevokeMask __attribute__((packed));
  178.     __u32 maximumSpace __attribute__((packed));
  179. };
  180.  
  181. struct nw_file_info {
  182.     struct nw_info_struct i;
  183.     int opened;
  184.     int access;
  185.     __u32 server_file_handle __attribute__((packed));
  186.     __u8 open_create_action __attribute__((packed));
  187.     __u8 file_handle[6] __attribute__((packed));
  188. };
  189.  
  190. struct nw_search_sequence {
  191.     __u8 volNumber __attribute__((packed));
  192.     __u32 dirBase __attribute__((packed));
  193.     __u32 sequence __attribute__((packed));
  194. };
  195.  
  196. #endif                /* _LINUX_NCP_H */
  197.